package com.ys.utils;

/**
 * <p>@description:</p>
 *
 * @projectName: Spring-Mini
 * @packageName: com.com.ys.utils
 * @className:
 * @author: shuangyang
 * @date: 1/15/17 2:28 PM
 */
public class Assert {
    /**
     * Assert that an object is<code>null</code>
     * @param object the object to check
     * @param message
     * @throws IllegalArgumentException
     */
    public static void isNull(Object object,String message) throws IllegalArgumentException {
        if (object!=null) {
            throw new IllegalArgumentException(message);
        }
    }

    /**
     * Assert that an object is not<code>null</code>
     * @param object the object to check
     * @param message
     * @throws IllegalArgumentException
     */
    public static void notNull(Object object,String message) throws IllegalArgumentException {
        if (object==null) {
            throw new IllegalArgumentException(message);
        }
    }
}


